package com.lesso.cyg.sunflower.core;

import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
import com.lesso.cyg.sunflower.model.BaseModel;
import net.bytebuddy.asm.Advice;
import org.apache.ibatis.reflection.MetaObject;

import java.time.LocalDateTime;

public class MyMetaObjectHandler extends MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        this.setFieldValByName("createTime", LocalDateTime.now(), metaObject);
        this.updateFill(metaObject);
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
    }
}
